{
	// inspired by Douglas Crockford's Remedial JavaScript page...
	// http://javascript.crockford.com/remedial.html

	typeOf : function (value)
	{	
		var t = typeof value;
		if (t !== 'object') return t;
		if (value === null) return 'null';
		if (value === undefined) return 'undefined';
		if (value instanceof Array) return 'array';
		return 'object';
	},
	
	isEmpty : function (value)
	{
		var t = this.typeOf (value);
		if (t !== 'array' && t !== 'object') return false;
		for (var i in value) return false;
		return true;
	},
	
	entityify : function (s)
	{
		return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
	}
}
